<template>
  <div v-if="menuInfo.items.length > 0 && menuInfo.id > 0" class="menu-group">
    <h1 class="title">
      {{ menuInfo.name }}
    </h1>
    <menu-item v-for="menu in menuInfo.items" :key="menu.id" :menu="menu" />
  </div>
</template>

<script>
import MenuItem from './menu-item.vue'

export default {
  name: 'OfficeMenuGroup',
  components: { MenuItem },
  props: {
    menuInfo: {
      type: Object,
      default: () => ({}),
    },
  },
}
</script>

<style lang="scss" scoped>
.menu-group {
  position: relative;
  border-radius: 4px;
  padding: 39px 0 15px;
  margin: 10px 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  .title {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #739eca;
    font-size: 12px;
    color: #fff;
    line-height: 12px;
    padding: 6px 8px 6px 6px;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
  }
}
</style>
